from django.shortcuts import render
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from .models import CrawlerTask
from .serializers import CrawlerTaskSerializer
from rest_framework import generics
from rest_framework.permissions import IsAdminUser

class CrawlerTaskList(generics.ListCreateAPIView):
    queryset = CrawlerTask.objects.all()
    serializer_class = CrawlerTaskSerializer

class CrawlerTaskDetail(generics.RetrieveUpdateDestroyAPIView):
    queryset = CrawlerTask.objects.all()
    serializer_class = CrawlerTaskSerializer

